<meta charset="utf-8">
<link href="__resource_path__/ui-framework/easyui-1.5.2/themes/metro/easyui-c5a176a3d4.css" rel="stylesheet" />
<link href="__resource_path__/ui-framework/easyui-1.5.2/themes/icon-77a4ded0c8.css" rel="stylesheet" />

<link href="__resource_path__/ui-framework/bootstrap/3.0.3/css/bootstrap-a067b6d831.min.css" rel="stylesheet" />
<link href="__resource_path__/ui-framework/bootstrap-daterangepicker/css/daterangepicker-886dba62c4.css" rel="stylesheet" />
<style>
  table{width:275px;height:200px;margin:0 auto;font-size:14px;}
  /*td{width:200px;}*/
  .title{text-align:right;width:80px;}
  input{text-align:left;width:140px}
  .submit{width:50px;text-align:center;background-color:#fff;border:1px solid #000;border-radius: 5px;}
  .daoru{color:#06a8f9;font-size:12px;margin-left:10px;}
</style>

<div class="lay-box">
    <div class="lay-content">
        <table>
        <tr>
          <td class="title">开始时间</td>
          <td>
            <input type="text" class="form-control" id="dateRange" style="width:140px" name="start_time" value="{:date('Y-m-d H:i',$data.start_time)}">
          </td>
        </tr>
        <tr>
          <td class="title">团名称</td>
          <td>
            <input type="text" name="name" value="{$data.name}">
          </td>
        </tr>`
        <tr>
          <td class="title">人数</td>
          <td>
            <input type="text" name="number" value="{$data.number}">
          </td>
        </tr>
        <tr>
          <td></td>
          <td>
            <input  class="submit" type="submit" value="创建" onclick="add()">

          </td>
        </tr>
        <input type="hidden" name="id" value="{$data.id}">
       </table>
    </div>
</div>
<script src="__resource_path__/libs/jquery/jquery-1-4ed679c998.11.3.min.js"></script>
<script src="__resource_path__/ui-framework/bootstrap/3.0.3/js/bootstrap-7b3098bda9.min.js"></script>
<script src="__resource_path__/ui-framework/bootstrap-daterangepicker/js/moment-zh_cn-3d8809ccd6.js"></script>
<script src="__resource_path__/ui-framework/bootstrap-daterangepicker/js/daterangepicker-bca1a72d19.js"></script>
<script src="__static_path__/js/layer/layer.js"></script>
<script type="text/javascript">
var beginTimeTake;
            
$('#dateRange').daterangepicker({
    singleDatePicker: true,
    showDropdowns: true,
    autoUpdateInput: false,
    timePicker24Hour : true,
    timePicker : true,
    "locale": {
        format: 'YYYY-MM-DD HH:mm',
        applyLabel: "应用",
        cancelLabel: "取消",
        resetLabel: "重置",
    }
}, 
function(start, end, label) {
    beginTimeTake = start;
    if(!this.startDate){
        this.element.val('');
    }else{
        this.element.val(this.startDate.format(this.locale.format));
    }
});


function add(){
      var start_time = $('input[name=start_time]').val();
      var name = $('input[name=name]').val();
      var number = $('input[name=number]').val();
      var id = $('input[name=id]').val();
      $.post('/index/group/edit',{id:id,start_time:start_time,name:name,number:number},function(res){
            layer.msg(res.msg);
            if(res.code == 1){
                window.setTimeout(function(){
                    window.parent.location.reload();
                },1000);
            }
        });
}
</script>
